How to save byte[] to varbinary(64) field in database
Posted
by shamim
on Stack Overflow
See other posts from Stack Overflow
or by shamim
Published on 2010-06-07T18:19:57Z
Indexed on
2010/06/07
18:32 UTC
Read the original article
Hit count: 258
I have
byte[] a = HashEncrypt("a");
with
public byte[] HashEncrypt(string password)
{
SHA512Managed sha = new SHA512Managed();
byte[] hash = sha.ComputeHash(UnicodeEncoding.Unicode.GetBytes(password));
return hash;
}
I want to save byte[] a
to my database. My database field is a varbinary(64)
. I'm using SQL Server 2008. I want to know the insert query with C# code.
I am using ADO.NET
© Stack Overflow or respective owner